import cardlibs
import threading

class card (threading.thread):
    def __init__(self, cardid, rarity, fromset):
        self.cardid = cardid
        self.rarity = rarity
        self.fromset = self.fromset
        self.position = None
        threading.Thread.__init__ ( self )
    def flip(position, currentposs):
        if self.ismonster() != False:
            if currentpos == "FaceAttack":
                if position == "FaceDefense":
                    self.facedef()

class monster (card):
    def __init__(self, cardid, rarity, fromset):
        self.effecttype = info.geteffecttype(self.cardid)
        if self.effecttype == "flip":
            self.effect = effects.Monster.Effect.flip(self.cardid)
        elif self.effecttype == "normal":
            self.effect = effects.Monster.Effect.normal(self.cardid)
        elif self.effecttype == "exodia":
            self.partnum = info.getexodiapartnum(self.cardid)
            self.effect = effects.Monster.Effect.Exodia(self.partnum)
        elif self.effecttype == None:
            self.effect = None
        card.__init__(self, cardid, rarity, fromset)
